""""
演示地图可视化的基本使用
"""
from pyecharts.charts import Map
from pyecharts.options import VisualMapOpts

#准备地图对象
map = Map()

# 准备数据
data = [
    ("上海市",99),
    ("北京市",199),
    ("湖南省",299),
    ("台湾省",399),
    ("广东省",499),
]


# 添加数据
map.add("测试地图", data, "china")


# 设置全局变量
map.set_global_opts(
    visualmap_opts=VisualMapOpts(
        is_show=True,
        is_piecewise=True,
        pieces=[
            {"min":1,"max":9,"label":"1-9人","color":"#124156"},
            {"min":10,"max":99,"label":"10-99人","color":"#eff467"},
            {"min":100,"max":199,"label":"100-199人","color":"#f4cc67"},
            {"min":200,"max":500,"label":"200-500人","color":"#da1632"}

        ]
    )
)
# 绘图
map.render()

# 生成图像




